package com.firewolf.springboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StuController {

	@Autowired
	private StuDao dao;
	
	@RequestMapping("createtable")
	public String createTable(){
		dao.createTable();
		return "success";
	}
	
	@RequestMapping("save")
	public String save(){
		Student s  = new Student();
		s.setName("zhangsna");
		s.setAge(23);
		s.setSex("男");
		s.setNote("sabbati");
		dao.save(s);
		return "save ok";
	}
}
